﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;
namespace XBYTestManagement
{
    public partial class FrmMain : KryptonForm
    {
        KryptonForm childFrm;
        public FrmMain()
        {
            InitializeComponent();
            
        }

        private void kryptonLabel1_Paint(object sender, PaintEventArgs e)
        {


        }

        //新建子窗体菜单项单击事件
        private void miSolutionCreate_Click(object sender, EventArgs e)
        {
            
            if (childFrm != null )
            {
                //关闭当前子窗体
                childFrm.Close();
                childFrm = null;
            }
            //建立新窗体
            childFrm = new FrmSolution();
            childFrm.Dock = System.Windows.Forms.DockStyle.Fill;
            childFrm.TopLevel = false;
            childFrm.Width = pnlCenter.Width;
            childFrm.Height = pnlCenter.Height;
            //childFrm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
          
            pnlCenter.Controls.Add(childFrm);
            childFrm.Show();
            
        }

        
        private void frmMain_Resize(object sender, EventArgs e)
        {
            //设置嵌入子窗体的size
            //if (childFrm != null)
            //{
            //    childFrm.Width = pnlCenter.Width;
            //    childFrm.Height = pnlCenter.Height;
            //    childFrm.Refresh();
            //}
           
            //childFrm.Dock = System.Windows.Forms.DockStyle.Fill;
        }

        private void miSolutionDesign_Click(object sender, EventArgs e)
        {

            if (childFrm != null)
            {
                //关闭当前子窗体
                childFrm.Close();
                childFrm = null;
            }
            //建立新窗体
            childFrm = new FrmSolution();
            childFrm.TopLevel = false;
            childFrm.Width = pnlCenter.Width;
            childFrm.Height = pnlCenter.Height;
            
            childFrm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            childFrm.Dock = System.Windows.Forms.DockStyle.Fill;
            //childFrm.Parent = pnlCenter;
            pnlCenter.Controls.Add(childFrm);
            childFrm.Show();
            childFrm.WindowState = FormWindowState.Normal;
          
        }


       

    } 
}
